<template>
	<EChart :id="id"  :class="className" :options="options" >

	</EChart>

</template>
<script>
	import EChart from './EChart'
	export default {
		props: ['data','title' , 'serialName','id'],
		components: {
	      EChart
	    },
		data() {
			return {
				className:'',
				options: {}
			}
		},
		created:function(){
  
			 this.options =  {
                title : {
                    text: this.title,
                    x:'center'
                },
                tooltip : {
                    trigger: 'item',
                    formatter: "{a} <br/>{b} : {c} ({d}%)"
                },
                series : [
                    {
                        name: this.serialName,
                        type: 'pie',
                        radius : '55%',
                        center: ['50%', '60%'],
                        data: this.data,
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            }  

		},
		mounted: function(){
	     
	    }


	}

</script>

